package s_001_Bean_Registered.config.classScan;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;

/**
 * @ComponentScan value: 指定要扫描的包
 * excludeFilters = Filter[]：指定扫描的时候按照什么规则排除那些组件
 * includeFilters = Filter[]：指定扫描的时候只需要包含哪些组件
 * FilterType.ANNOTATION：按照注解
 * FilterType.ASSIGNABLE_TYPE：按照给定的类型；
 * FilterType.ASPECTJ：使用ASPECTJ表达式
 * FilterType.REGEX：使用正则指定
 * FilterType.CUSTOM：使用自定义规则
 */

/*@ComponentScan(value = "com.test", excludeFilters = { // 包扫排除过滤
        @ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class, Service.class})
})
@ComponentScan(value = "com.test", includeFilters = { // 包扫只包含过滤
        @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Controller.class})
}, useDefaultFilters = false)*/

/*@ComponentScans(value = { // 非 JDK1.8
        @ComponentScan(value = "com.test", excludeFilters = { // 包扫排除过滤
                @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Controller.class, Service.class})
        }),
        @ComponentScan(value = "com.test", includeFilters = { // 包扫只包含过滤
                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {Tmp.class})
        }, useDefaultFilters = false)
})*/

@ComponentScan(value = "s_001_Bean_Registered", includeFilters = { // 包扫只包含过滤
        @ComponentScan.Filter(type = FilterType.CUSTOM, classes = {MyTypeFilter.class}) // 自定义过滤
}, useDefaultFilters = false)
@Configuration
public class ScanConfig {
}
